import * as types from "./mutations-types"
import { cacheCompanyId, cacheToken } from "@/utils/storage"

export default {
  [types.SET_TOKEN](state, token) {
    cacheToken(token)
    state.token = token
  },
  [types.SET_USERINFO](state, info) {
    state.userInfo = info
  },
  [types.SET_ROUTERMAP](state, arr) {
    state.routerMap = [...arr]
  },
  [types.SET_COMPANYID](state, id) {
    cacheCompanyId(id)
    state.companyId = id
  },

  [types.SET_COMPANY_INFO](state, value) {
    state.companyInfo = value
  },
  [types.SET_CITYS](state, citys) {
    state.citys = citys
  },
  [types.SET_CITYSPO](state, citysPo) {
    state.citysPo = citysPo
  },
  [types.SET_CITY_INFO](state, info) {
    state.cityInfo = info
  }
}
